package view;

import javax.swing.*;
import controller.*;
import model.GameClient;

@SuppressWarnings("serial")
public class FileMenu extends JMenuBar
{
	private JMenuItem connect = new JMenuItem("Connect");
	private JMenuItem createGame = new JMenuItem("Create Game");
	private JMenuItem queue = new JMenuItem("Queue for Game");
	private JMenuItem exit = new JMenuItem("Exit");

	private JMenuItem help = new JMenuItem("Help");
	private JMenuItem aboutProgram = new JMenuItem("About the Program");

	public FileMenu(GameClient gameClient)
	{
		JMenu fileMenu = new JMenu("File");
		JMenu helpMenu = new JMenu("Help");

		this.add(fileMenu);
		this.add(helpMenu);

		fileMenu.add(connect);
		fileMenu.add(createGame);
		fileMenu.add(queue);
		fileMenu.addSeparator();
		fileMenu.add(exit);

		helpMenu.add(help);
		helpMenu.add(aboutProgram);

		connect.addActionListener(new ConnectListener(gameClient));
		createGame.addActionListener(new CreateGameListener(gameClient));
		queue.addActionListener(new QueueListener(gameClient));
		exit.addActionListener(new ExitListener(gameClient));

		aboutProgram.addActionListener(new AboutProgramListener(gameClient));
		help.addActionListener(new HelpListener(gameClient));
	}
}
